package com.small.auth.service;


import lombok.AllArgsConstructor;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 登录配置中心
 * @author wangguochao
 */
@Service
@AllArgsConstructor
public class CustomUserDetailsService {
    private final WxWeChatService wxWeChatService;
    private final WxWeChatPawService wxWeChatPawService;
    private final PawVerifyService pawVerifyService;


    /**
     * 小程序登录默认
     */
    public UserDetails loadUserByJsCode(Map<String, String> param) {
        return wxWeChatService.loadUserByJsCode(param);
    }

    /**
     * 小程序登录密码
     */
    public UserDetails loadUserByPaw(Map<String, String> param) {
        return wxWeChatPawService.loadUserByPaw(param);
    }

    /**
     * 验证码登录
     */
    public UserDetails loadUserByPawAndVerify(Map<String, String> param) {
        return pawVerifyService.loadUserByPawAndVerify(param);
    }
}
